#include <iostream>
using namespace std;
#include "Cube.h"
#include "Circle.h"
#include "Point.h"

//案例1   设计立方体类(Cube) ,求出立方体的面积和体积
//              求两个立方体 是否相等(全局函数和成员函数)

//全局函数
//1相等 0不想等
int judge(Cube &v1, Cube &v2){
        if(   (v1.getA() == v2.getA()) && 
                (v1.getB()==v2.getB()) && 
                (v1.getC() == v2.getC()) ){
                return 1;
        }
        return 0;
}
int main01(int argc, char const *argv[]){
        Cube v1, v2;
        v1.setABC(1, 2, 3);
        cout<<v1.getS()<<endl;
        cout<<v1.getV()<<endl;

        v2.setABC(1,2,4);
        
        //判断两个立方体是否相等
        if(judge(v1, v2) == 1){
                cout<<"相等"<<endl;
        }else{
                cout<<"不想等"<<endl;
        }

        if(v1.judgeCube(v2)){
                cout<<"相等"<<endl;
        }else{
                cout<<"不想等"<<endl;
        }

        v2.setABC(1,2,3);
        if(v1.judgeCube(v2)){ //判断v1立方体 和 v2的立方体是否相等, 通过类的成员函数
                cout<<"相等"<<endl;
        }else{
                cout<<"不想等"<<endl;
        }
        return 0;
}

//2 求点在圆的外面还是在圆内部
int main(int argc, char const *argv[]){
        Circle c1;
        Point p1;

        c1.setCircle(2, 3, 3);
        p1.setPoint(7, 7);

        if(c1.judge(p1)){
                cout<<"点在圆内"<<endl;
        }else{
                cout<<"点在圆外"<<endl;
        }

        return 0;
}

